package edu.ccut.titan.service;

import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

public abstract class ServiceFactory {
	
	public static ITitanManagerService getComponentManagerService(BundleContext context) {
		ServiceReference reference = context.getServiceReference(ITitanManagerService.class.getName());
	
		if (reference == null) {
			return null;
		}
		return (ITitanManagerService)context.getService(reference);
	}
	
	public static ITitanPropertiesService geTitanPropertiesService(BundleContext context) {
		ServiceReference reference = context.getServiceReference(ITitanPropertiesService.class.getName());
		
		if (reference == null) {
			return null;
		}
		return (ITitanPropertiesService)context.getService(reference);
	}
}	
